package model.components.nodes.node.virtual;

import model.components.nodes.node.Node;

public class VirtualMachine extends VirtualNode
{	
	public VirtualMachine( String networkName, int startingDate, int endingDate, int number, String os, int cpu, int ram, int storage )
	{
		super( networkName, startingDate, endingDate, VirtualMachine.class.getSimpleName(), number, Node.SERVER_TYPE, os, cpu, ram, Node.GREY_VIRTUAL_MACHINE, Node.GREEN_VIRTUAL_MACHINE, Node.YELLOW_VIRTUAL_MACHINE, Node.RED_VIRTUAL_MACHINE );
		
		this.setStorage( storage );
	}
	
	@Override
	public VirtualMachine getCopy()
	{
		VirtualMachine virtualMachine = new VirtualMachine( this.getNetworkName(), this.getStartingDate(), this.getEndingDate(), this.getNumber(), this.getOS(), this.getCPU(), this.getRAM(), this.getStorage() );
		virtualMachine.setInitialNumber( this.getInitialNumber() );
		virtualMachine.setNamePrefix( this.getNamePrefix() );
		virtualMachine.setType( this.getType() );
		virtualMachine.setTimeStamp( this.getTimeStamp() );
		virtualMachine.setSelected( this.isSelected() );
		
		if( this.getSdnNode() != null )
			virtualMachine.setSdnNode( this.getSdnNode().getSoftCopy() );
		
		virtualMachine.setCPUprice( this.getCPUprice() );
		virtualMachine.setRAMprice( this.getRAMprice() );
		virtualMachine.setStoragePrice( this.getStoragePrice() );
		
		return virtualMachine;
	}

}
